/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.pay.j;

import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import android.util.SparseArray;
import com.qihoo.gamecenter.sdk.common.d.a;
import com.qihoo.gamecenter.sdk.common.d.a.a;
import com.qihoo.gamecenter.sdk.common.h.d;
import com.qihoo.gamecenter.sdk.common.h.d.a;
import com.qihoo.gamecenter.sdk.common.i.s;
import com.qihoo.gamecenter.sdk.pay.k.c;
import com.qihoo.gamecenter.sdk.pay.k.g;
import java.util.Map;
import java.util.TreeMap;
import org.json.JSONObject;

public class r extends d {
    private Intent b;

    public r(Context paramContext, d.a parama, Intent paramIntent) {
        super(paramContext, parama, true);
        this.b = paramIntent;
    }

    protected String a(Context paramContext, String[] paramArrayOfString) {
        return null;
    }

    protected String a() {
        return "https://mgame.360.cn/internal/mobile_pay.json";
    }

    protected Map b(Context paramContext, String[] paramArrayOfString) {
        String str1 = a(0, paramArrayOfString);
        String str2 = a(1, paramArrayOfString);
        String str3 = a(2, paramArrayOfString);
        str1 = com.qihoo.gamecenter.sdk.common.f.b.a().a(str1);
        str2 = com.qihoo.gamecenter.sdk.common.f.b.a().a(str2);
        TreeMap localTreeMap = new TreeMap();
        localTreeMap.put("access_token", this.b.getStringExtra("access_token"));
        localTreeMap.put("amount", this.b.getStringExtra("pay_amount"));
        localTreeMap.put("app_key", s.r(paramContext));
        localTreeMap.put("app_uid", this.b.getStringExtra("app_user_id"));
        localTreeMap.put("app_ext1", this.b.getStringExtra("app_ext_1"));
        localTreeMap.put("app_ext2", this.b.getStringExtra("app_ext_2"));
        localTreeMap.put("app_order_id", this.b.getStringExtra("app_order_id"));
        localTreeMap.put("app_uname", this.b.getStringExtra("app_user_name"));
        localTreeMap.put("bank_code", this.b.getStringExtra("bank_code"));
        localTreeMap.put("card_amount", str3);
        localTreeMap.put("card_number", str1);
        localTreeMap.put("card_pwd", str2);
        localTreeMap.put("notify_uri", this.b.getStringExtra("notify_uri"));
        localTreeMap.put("pay_mode", "21");
        localTreeMap.put("platform_id", "2");
        localTreeMap.put("product_id", this.b.getStringExtra("product_id"));
        localTreeMap.put("product_name", this.b.getStringExtra("product_name"));
        localTreeMap.put("sign_type", "md5");
        localTreeMap.put("src", s.u(paramContext));
        localTreeMap.put("user_id", this.b.getStringExtra("qihoo_user_id"));
        localTreeMap.put("crypt_type", "rsa");
        String str4 = com.qihoo.gamecenter.sdk.pay.e.b.a(paramContext);
        if (!(TextUtils.isEmpty(str4)))
            localTreeMap.put("quick_info", str4);
        String str5 = com.qihoo.gamecenter.sdk.pay.e.b.b(paramContext);
        if (!(TextUtils.isEmpty(str5)))
            localTreeMap.put("risk_control", str5);
        localTreeMap.put("st", g.a("1"));
        String str6 = s.a(localTreeMap, s.s(paramContext));
        c.a("OAMobileCardPayTask", new Object[] { "https://mgame.360.cn/internal/mobile_pay.json", "?", str6 });
        return localTreeMap;
    }

    protected a b(JSONObject paramJSONObject) {
        if (paramJSONObject != null) {
            int i = paramJSONObject.optInt("error_code", -1);
            String str1 = paramJSONObject.optString("error");
            String str2 = paramJSONObject.optString("order_id");
            String str3 = paramJSONObject.optString("card_type_name");
            String str4 = paramJSONObject.optString("card_number");
            a locala = new a();
            a.a(locala, i);
            a.a(locala, str1);
            a.b(locala, str4);
            a.c(locala, str3);
            a.d(locala, str2);
            return locala;
        }
        return null;
    }

    public static class a {
        public static int a = 0;
        public static int b = 17;
        public static int c = 19;
        private static final String d = a.a(a.a.bK);
        private static final SparseArray e = new SparseArray();
        private int f;
        private String g;
        private String h;
        private String i;
        private String j;

        private void a(int paramInt) {
            this.f = paramInt;
        }

        public int a() {
            return this.f;
        }

        public boolean b() {
            return (this.f == a);
        }

        private void a(String paramString) {
            this.g = paramString;
        }

        private void b(String paramString) {
            this.h = paramString;
        }

        private void c(String paramString) {
            this.i = paramString;
        }

        public String c() {
            String str1 = (String) e.get(this.f);
            if (!(TextUtils.isEmpty(str1)))
                this.i = str1;
            String str2 = null;
            if ((!(TextUtils.isEmpty(this.h))) && (!(TextUtils.isEmpty(this.g))))
                str2 = String.format(d, new Object[] { this.g, this.h });
            if (str2 == null)
                return this.i;
            return str2 + this.i;
        }

        private void d(String paramString) {
            this.j = paramString;
        }

        public String d() {
            return this.j;
        }

        static {
            e.append(19, a.a(a.a.bD));
            e.append(17, a.a(a.a.bF));
            e.append(16, a.a(a.a.bG));
            e.append(15, a.a(a.a.bH));
            e.append(1014, a.a(a.a.bI));
        }
    }
}